<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"flat"},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="JavaScript对象重点概念 必须 Array对象concat()方法    数组连接concat()方法用于连接两个或多个数组 该方法不会改变现有的数组，而仅仅会返回被连接数组的一个副本。 语法 1array1.concat(array2,array3,...,arrayX)">
<meta property="og:type" content="article">
<meta property="og:title" content="JavaScript内置对象">
<meta property="og:url" content="http://yoursite.com/2020/04/13/%E5%89%8D%E7%AB%AF/JavaScript/JavaScript%E5%86%85%E7%BD%AE%E5%AF%B9%E8%B1%A1/index.html">
<meta property="og:site_name" content="heweiliang blog">
<meta property="og:description" content="JavaScript对象重点概念 必须 Array对象concat()方法    数组连接concat()方法用于连接两个或多个数组 该方法不会改变现有的数组，而仅仅会返回被连接数组的一个副本。 语法 1array1.concat(array2,array3,...,arrayX)">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-04-13T09:16:18.319Z">
<meta property="article:modified_time" content="2020-06-27T02:22:32.666Z">
<meta property="article:author" content="heweiliang">
<meta property="article:tag" content="前端">
<meta property="article:tag" content="JavaScript">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/04/13/%E5%89%8D%E7%AB%AF/JavaScript/JavaScript%E5%86%85%E7%BD%AE%E5%AF%B9%E8%B1%A1/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>JavaScript内置对象 | heweiliang blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="heweiliang blog" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">heweiliang blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-schedule">

    <a href="/schedule/" rel="section"><i class="fa fa-fw fa-calendar"></i>日程表</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/yourname" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/04/13/%E5%89%8D%E7%AB%AF/JavaScript/JavaScript%E5%86%85%E7%BD%AE%E5%AF%B9%E8%B1%A1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="heweiliang">
      <meta itemprop="description" content="heweiliang blog">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="heweiliang blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          JavaScript内置对象<a href="https://github.com/user-name/repo-name/tree/branch-name/subdirectory-name_posts/%E5%89%8D%E7%AB%AF/JavaScript/JavaScript%E5%86%85%E7%BD%AE%E5%AF%B9%E8%B1%A1.md" class="post-edit-link" title="编辑" rel="noopener" target="_blank"><i class="fa fa-pencil"></i></a>
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-04-13 17:16:18" itemprop="dateCreated datePublished" datetime="2020-04-13T17:16:18+08:00">2020-04-13</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-06-27 10:22:32" itemprop="dateModified" datetime="2020-06-27T10:22:32+08:00">2020-06-27</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/CSS/" itemprop="url" rel="index"><span itemprop="name">CSS</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>10k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>9 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="JavaScript对象"><a href="#JavaScript对象" class="headerlink" title="JavaScript对象"></a>JavaScript对象</h1><p><font color="red" size="4" style="background:#E0E0E0">重点概念</font></p>
<p><code>必须</code></p>
<h2 id="Array对象"><a href="#Array对象" class="headerlink" title="Array对象"></a>Array对象</h2><h3 id="concat-方法-数组连接"><a href="#concat-方法-数组连接" class="headerlink" title="concat()方法    数组连接"></a>concat()方法    <code>数组连接</code></h3><p>concat()方法用于连接两个或多个数组</p>
<p>该方法不会改变现有的数组，而仅仅会返回被连接数组的一个副本。</p>
<p>语法</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array1.concat(array2,array3,...,arrayX)</span><br></pre></td></tr></table></figure>

<p>参数</p>
<p>数组</p>
<h3 id="copyWithin-方法-同一数组元素的位置调换"><a href="#copyWithin-方法-同一数组元素的位置调换" class="headerlink" title="copyWithin()方法 同一数组元素的位置调换"></a>copyWithin()方法 <code>同一数组元素的位置调换</code></h3><p>copyWithin()方法用于从数组的指定位置拷贝元素到数组的另一个指定位置中</p>
<p>语法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array.copyWithin(target, start, end)</span><br></pre></td></tr></table></figure>

<p>IE 11 及更早版本不支持 copyWithin() 方法。</p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><em>target</em>（复制的目标位置）</td>
<td align="left">必需。复制到指定目标索引位置。</td>
</tr>
<tr>
<td align="left"><em>start</em>（复制的起始位置）</td>
<td align="left">可选。元素复制的起始位置。</td>
</tr>
<tr>
<td align="left"><em>end</em>(复制的个数)</td>
<td align="left">可选。停止复制的索引位置 (默认为 <em>array</em>.length)。如果为负值，表示倒数。</td>
</tr>
</tbody></table>
<blockquote>
<p>两个参数的时候，start == target </p>
<p>array.copyWithin(target(start), end) </p>
</blockquote>
<p>遍历的方法</p>
<p>forEach<br>every<br>some<br>filter<br>map<br>reduce<br>reduceRight</p>
<h3 id="entries-ES6"><a href="#entries-ES6" class="headerlink" title="entries(ES6)"></a>entries(ES6)</h3><p>返回一个数组的可迭代对象。该对象包含数组的键值对</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array.entries()</span><br></pre></td></tr></table></figure>



<p>find&amp;findIndex(ES6)<br>keys(ES6)<br>values(ES6)<br>Symbol.iterator(ES6)</p>
<h2 id="Boolean对象-constructor-prototype-toString-valueOf"><a href="#Boolean对象-constructor-prototype-toString-valueOf" class="headerlink" title="Boolean对象 constructor prototype toString() valueOf()"></a>Boolean对象 <code>constructor prototype toString() valueOf()</code></h2><p>Boolean对象用于转换一个不是Boolearn类型的值转换为Boolean类型值（true）或（false）</p>
<h3 id="新建一个Boolean对象"><a href="#新建一个Boolean对象" class="headerlink" title="新建一个Boolean对象"></a>新建一个Boolean对象</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> bool = <span class="keyword">new</span> Boolearn(<span class="number">1</span>)</span><br><span class="line"><span class="keyword">var</span> bool = <span class="keyword">new</span> Boolearn(<span class="number">0</span>)</span><br></pre></td></tr></table></figure>

<h3 id="对象属性"><a href="#对象属性" class="headerlink" title="对象属性"></a>对象属性</h3><h4 id="constru-ctor-返回对创建此对象的-Boolean-函数的引用"><a href="#constru-ctor-返回对创建此对象的-Boolean-函数的引用" class="headerlink" title="constru ctor 返回对创建此对象的 Boolean 函数的引用"></a>constru ctor <code>返回对创建此对象的 Boolean 函数的引用</code></h4><ul>
<li>boolean.constructor</li>
<li>constructor   n. 构造函数；构造器；建造者</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> bool = <span class="keyword">new</span> <span class="built_in">Boolean</span>(<span class="number">0</span>);</span><br><span class="line"><span class="keyword">var</span> x = bool.constructor;</span><br><span class="line"><span class="built_in">console</span>.log(x);</span><br><span class="line"></span><br><span class="line">ƒ <span class="built_in">Boolean</span>() &#123; [native code] &#125;</span><br></pre></td></tr></table></figure>



<h4 id="prototype-使您有能力向对象添加属性和方法。"><a href="#prototype-使您有能力向对象添加属性和方法。" class="headerlink" title="prototype 使您有能力向对象添加属性和方法。"></a>prototype <code>使您有能力向对象添加属性和方法。</code></h4><ul>
<li>当构造一个原型，所有的布尔对象默认都添加了属性或方法。</li>
<li>定义：Boolean.prototype.name=value（function(){}）</li>
<li>使用：boolean.name()</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">Boolean</span>.prototype.myColor = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">     <span class="keyword">if</span>(<span class="keyword">this</span>.valueOf() == <span class="literal">true</span>)&#123;</span><br><span class="line">            <span class="keyword">this</span>.color = <span class="string">'green'</span>;</span><br><span class="line">      &#125;</span><br><span class="line">      <span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="keyword">this</span>.color = <span class="string">'red'</span>;</span><br><span class="line">       &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">var</span> a = <span class="keyword">new</span> <span class="built_in">Boolean</span>(<span class="number">1</span>);</span><br><span class="line">a.myColor();</span><br><span class="line"><span class="built_in">console</span>.log(a.color);</span><br></pre></td></tr></table></figure>



<h3 id="对象方法toSting-转为字符串-valueOf-返回原始值"><a href="#对象方法toSting-转为字符串-valueOf-返回原始值" class="headerlink" title="对象方法toSting() 转为字符串 valueOf() 返回原始值"></a>对象方法<code>toSting() 转为字符串 valueOf() 返回原始值</code></h3><h4 id="toString-布尔值转为字符串，并返回结果"><a href="#toString-布尔值转为字符串，并返回结果" class="headerlink" title="toString() 布尔值转为字符串，并返回结果"></a>toString() 布尔值转为字符串，并返回结果</h4><ul>
<li>boolean.toString()</li>
<li>数据类型是字符串</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"> <span class="keyword">var</span> bool2 = <span class="keyword">new</span> <span class="built_in">Boolean</span>(<span class="number">0</span>);</span><br><span class="line"><span class="keyword">var</span> myvar2 = bool2.toString();</span><br><span class="line"><span class="built_in">console</span>.log(myvar2);</span><br><span class="line"><span class="built_in">console</span>.log(<span class="keyword">typeof</span>(myvar2));</span><br></pre></td></tr></table></figure>



<h4 id="valueOf-返回-Boolean-对象的原始值"><a href="#valueOf-返回-Boolean-对象的原始值" class="headerlink" title="valueOf() 返回 Boolean 对象的原始值"></a>valueOf() 返回 Boolean 对象的原始值</h4><ul>
<li>boolean.valueOf()</li>
<li>数据类型还是布尔值</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"> <span class="keyword">var</span> bool = <span class="keyword">new</span> <span class="built_in">Boolean</span>(<span class="number">1</span>);</span><br><span class="line"><span class="keyword">var</span> myvar = bool.valueOf();</span><br><span class="line"><span class="built_in">console</span>.log(myvar);</span><br><span class="line"><span class="built_in">console</span>.log(<span class="keyword">typeof</span> (myvar));</span><br></pre></td></tr></table></figure>



<h2 id="Dat对象"><a href="#Dat对象" class="headerlink" title="Dat对象"></a>Dat对象</h2><h2 id="Date-对象"><a href="#Date-对象" class="headerlink" title="Date 对象"></a>Date 对象</h2><p>Date 对象用于处理日期与时间。</p>
<p>创建 Date 对象： <strong>new Date()</strong></p>
<p>以下四种方法同样可以创建 Date 对象：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">var d &#x3D; new Date();</span><br><span class="line">var d &#x3D; new Date(milliseconds);</span><br><span class="line">var d &#x3D; new Date(dateString);</span><br><span class="line">var d &#x3D; new Date(year, month, day, hours, minutes, seconds, milliseconds);</span><br></pre></td></tr></table></figure>

<p>更完整的日期与实际教程请参照<a href="https://www.runoob.com/js/js-obj-date.html" target="_blank" rel="noopener"> JavaScript Date 对象教程</a>。</p>
<hr>
<h2 id="Date-对象属性"><a href="#Date-对象属性" class="headerlink" title="Date 对象属性"></a>Date 对象属性</h2><table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-constructor-date.html" target="_blank" rel="noopener">constructor</a></td>
<td align="left">返回对创建此对象的 Date 函数的引用。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-prototype-date.html" target="_blank" rel="noopener">prototype</a></td>
<td align="left">使您有能力向对象添加属性和方法。</td>
</tr>
</tbody></table>
<h2 id="Date-对象方法"><a href="#Date-对象方法" class="headerlink" title="Date 对象方法"></a>Date 对象方法</h2><table>
<thead>
<tr>
<th align="left">方法</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getdate.html" target="_blank" rel="noopener">getDate()</a></td>
<td align="left">从 Date 对象返回一个月中的某一天 (1 ~ 31)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getday.html" target="_blank" rel="noopener">getDay()</a></td>
<td align="left">从 Date 对象返回一周中的某一天 (0 ~ 6)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getfullyear.html" target="_blank" rel="noopener">getFullYear()</a></td>
<td align="left">从 Date 对象以四位数字返回年份。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-gethours.html" target="_blank" rel="noopener">getHours()</a></td>
<td align="left">返回 Date 对象的小时 (0 ~ 23)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getmilliseconds.html" target="_blank" rel="noopener">getMilliseconds()</a></td>
<td align="left">返回 Date 对象的毫秒(0 ~ 999)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getminutes.html" target="_blank" rel="noopener">getMinutes()</a></td>
<td align="left">返回 Date 对象的分钟 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getmonth.html" target="_blank" rel="noopener">getMonth()</a></td>
<td align="left">从 Date 对象返回月份 (0 ~ 11)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getseconds.html" target="_blank" rel="noopener">getSeconds()</a></td>
<td align="left">返回 Date 对象的秒数 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-gettime.html" target="_blank" rel="noopener">getTime()</a></td>
<td align="left">返回 1970 年 1 月 1 日至今的毫秒数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-gettimezoneoffset.html" target="_blank" rel="noopener">getTimezoneOffset()</a></td>
<td align="left">返回本地时间与格林威治标准时间 (GMT) 的分钟差。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcdate.html" target="_blank" rel="noopener">getUTCDate()</a></td>
<td align="left">根据世界时从 Date 对象返回月中的一天 (1 ~ 31)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcday.html" target="_blank" rel="noopener">getUTCDay()</a></td>
<td align="left">根据世界时从 Date 对象返回周中的一天 (0 ~ 6)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcfullyear.html" target="_blank" rel="noopener">getUTCFullYear()</a></td>
<td align="left">根据世界时从 Date 对象返回四位数的年份。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutchours.html" target="_blank" rel="noopener">getUTCHours()</a></td>
<td align="left">根据世界时返回 Date 对象的小时 (0 ~ 23)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcmilliseconds.html" target="_blank" rel="noopener">getUTCMilliseconds()</a></td>
<td align="left">根据世界时返回 Date 对象的毫秒(0 ~ 999)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcminutes.html" target="_blank" rel="noopener">getUTCMinutes()</a></td>
<td align="left">根据世界时返回 Date 对象的分钟 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcmonth.html" target="_blank" rel="noopener">getUTCMonth()</a></td>
<td align="left">根据世界时从 Date 对象返回月份 (0 ~ 11)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-getutcseconds.html" target="_blank" rel="noopener">getUTCSeconds()</a></td>
<td align="left">根据世界时返回 Date 对象的秒钟 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left">getYear()</td>
<td align="left">已废弃。 请使用 getFullYear() 方法代替。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-parse.html" target="_blank" rel="noopener">parse()</a></td>
<td align="left">返回1970年1月1日午夜到指定日期（字符串）的毫秒数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setdate.html" target="_blank" rel="noopener">setDate()</a></td>
<td align="left">设置 Date 对象中月的某一天 (1 ~ 31)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setfullyear.html" target="_blank" rel="noopener">setFullYear()</a></td>
<td align="left">设置 Date 对象中的年份（四位数字）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-sethours.html" target="_blank" rel="noopener">setHours()</a></td>
<td align="left">设置 Date 对象中的小时 (0 ~ 23)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setmilliseconds.html" target="_blank" rel="noopener">setMilliseconds()</a></td>
<td align="left">设置 Date 对象中的毫秒 (0 ~ 999)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setminutes.html" target="_blank" rel="noopener">setMinutes()</a></td>
<td align="left">设置 Date 对象中的分钟 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setmonth.html" target="_blank" rel="noopener">setMonth()</a></td>
<td align="left">设置 Date 对象中月份 (0 ~ 11)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setseconds.html" target="_blank" rel="noopener">setSeconds()</a></td>
<td align="left">设置 Date 对象中的秒钟 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-settime.html" target="_blank" rel="noopener">setTime()</a></td>
<td align="left">setTime() 方法以毫秒设置 Date 对象。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutcdate.html" target="_blank" rel="noopener">setUTCDate()</a></td>
<td align="left">根据世界时设置 Date 对象中月份的一天 (1 ~ 31)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutcfullyear.html" target="_blank" rel="noopener">setUTCFullYear()</a></td>
<td align="left">根据世界时设置 Date 对象中的年份（四位数字）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutchours.html" target="_blank" rel="noopener">setUTCHours()</a></td>
<td align="left">根据世界时设置 Date 对象中的小时 (0 ~ 23)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutcmilliseconds.html" target="_blank" rel="noopener">setUTCMilliseconds()</a></td>
<td align="left">根据世界时设置 Date 对象中的毫秒 (0 ~ 999)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutcminutes.html" target="_blank" rel="noopener">setUTCMinutes()</a></td>
<td align="left">根据世界时设置 Date 对象中的分钟 (0 ~ 59)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutcmonth.html" target="_blank" rel="noopener">setUTCMonth()</a></td>
<td align="left">根据世界时设置 Date 对象中的月份 (0 ~ 11)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-setutcseconds.html" target="_blank" rel="noopener">setUTCSeconds()</a></td>
<td align="left">setUTCSeconds() 方法用于根据世界时 (UTC) 设置指定时间的秒字段。</td>
</tr>
<tr>
<td align="left">setYear()</td>
<td align="left">已废弃。请使用 setFullYear() 方法代替。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-todatestring.html" target="_blank" rel="noopener">toDateString()</a></td>
<td align="left">把 Date 对象的日期部分转换为字符串。</td>
</tr>
<tr>
<td align="left">toGMTString()</td>
<td align="left">已废弃。请使用 toUTCString() 方法代替。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-toisostring.html" target="_blank" rel="noopener">toISOString()</a></td>
<td align="left">使用 ISO 标准返回字符串的日期格式。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tojson.html" target="_blank" rel="noopener">toJSON()</a></td>
<td align="left">以 JSON 数据格式返回日期字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tolocaledatestring.html" target="_blank" rel="noopener">toLocaleDateString()</a></td>
<td align="left">根据本地时间格式，把 Date 对象的日期部分转换为字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tolocaletimestring.html" target="_blank" rel="noopener">toLocaleTimeString()</a></td>
<td align="left">根据本地时间格式，把 Date 对象的时间部分转换为字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tolocalestring.html" target="_blank" rel="noopener">toLocaleString()</a></td>
<td align="left">据本地时间格式，把 Date 对象转换为字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tostring-date.html" target="_blank" rel="noopener">toString()</a></td>
<td align="left">把 Date 对象转换为字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-totimestring.html" target="_blank" rel="noopener">toTimeString()</a></td>
<td align="left">把 Date 对象的时间部分转换为字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-toutcstring.html" target="_blank" rel="noopener">toUTCString()</a></td>
<td align="left">根据世界时，把 Date 对象转换为字符串。实例：<code>var today = new Date(); var UTCstring = today.toUTCString();</code></td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-utc.html" target="_blank" rel="noopener">UTC()</a></td>
<td align="left">根据世界时返回 1970 年 1 月 1 日 到指定日期的毫秒数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-valueof-date.html" target="_blank" rel="noopener">valueOf()</a></td>
<td align="left">返回 Date 对象的原始值。</td>
</tr>
</tbody></table>
<h2 id="Math对象"><a href="#Math对象" class="headerlink" title="Math对象"></a>Math对象</h2><p>Math对象用于执行数学任务</p>
<h2 id="Math-对象属性"><a href="#Math-对象属性" class="headerlink" title="Math 对象属性"></a>Math 对象属性</h2><table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-e.html" target="_blank" rel="noopener">E</a></td>
<td align="left">返回算术常量 e，即自然对数的底数（约等于2.718）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-ln2.html" target="_blank" rel="noopener">LN2</a></td>
<td align="left">返回 2 的自然对数（约等于0.693）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-ln10.html" target="_blank" rel="noopener">LN10</a></td>
<td align="left">返回 10 的自然对数（约等于2.302）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-log2e.html" target="_blank" rel="noopener">LOG2E</a></td>
<td align="left">返回以 2 为底的 e 的对数（约等于 1.4426950408889634）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-log10e.html" target="_blank" rel="noopener">LOG10E</a></td>
<td align="left">返回以 10 为底的 e 的对数（约等于0.434）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-pi.html" target="_blank" rel="noopener">PI</a></td>
<td align="left">返回圆周率（约等于3.14159）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-sqrt1-2.html" target="_blank" rel="noopener">SQRT1_2</a></td>
<td align="left">返回 2 的平方根的倒数（约等于 0.707）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-sqrt2.html" target="_blank" rel="noopener">SQRT2</a></td>
<td align="left">返回 2 的平方根（约等于 1.414）。</td>
</tr>
</tbody></table>
<h2 id="Math-对象方法"><a href="#Math-对象方法" class="headerlink" title="Math 对象方法"></a>Math 对象方法</h2><table>
<thead>
<tr>
<th align="left">方法</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-abs.html" target="_blank" rel="noopener">abs(x)</a></td>
<td align="left">返回 x 的绝对值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-acos.html" target="_blank" rel="noopener">acos(x)</a></td>
<td align="left">返回 x 的反余弦值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-asin.html" target="_blank" rel="noopener">asin(x)</a></td>
<td align="left">返回 x 的反正弦值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-atan.html" target="_blank" rel="noopener">atan(x)</a></td>
<td align="left">以介于 -PI/2 与 PI/2 弧度之间的数值来返回 x 的反正切值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-atan2.html" target="_blank" rel="noopener">atan2(y,x)</a></td>
<td align="left">返回从 x 轴到点 (x,y) 的角度（介于 -PI/2 与 PI/2 弧度之间）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-ceil.html" target="_blank" rel="noopener">ceil(x)</a></td>
<td align="left">对数进行上舍入。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-cos.html" target="_blank" rel="noopener">cos(x)</a></td>
<td align="left">返回数的余弦。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-exp.html" target="_blank" rel="noopener">exp(x)</a></td>
<td align="left">返回 Ex 的指数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-floor.html" target="_blank" rel="noopener">floor(x)</a></td>
<td align="left">对 x 进行下舍入。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-log.html" target="_blank" rel="noopener">log(x)</a></td>
<td align="left">返回数的自然对数（底为e）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-max.html" target="_blank" rel="noopener">max(x,y,z,…,n)</a></td>
<td align="left">返回 x,y,z,…,n 中的最高值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-min.html" target="_blank" rel="noopener">min(x,y,z,…,n)</a></td>
<td align="left">返回 x,y,z,…,n中的最低值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-pow.html" target="_blank" rel="noopener">pow(x,y)</a></td>
<td align="left">返回 x 的 y 次幂。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-random.html" target="_blank" rel="noopener">random()</a></td>
<td align="left">返回 0 ~ 1 之间的随机数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-round.html" target="_blank" rel="noopener">round(x)</a></td>
<td align="left">四舍五入。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-sin.html" target="_blank" rel="noopener">sin(x)</a></td>
<td align="left">返回数的正弦。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-sqrt.html" target="_blank" rel="noopener">sqrt(x)</a></td>
<td align="left">返回数的平方根。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tan.html" target="_blank" rel="noopener">tan(x)</a></td>
<td align="left">返回角的正切。</td>
</tr>
</tbody></table>
<h2 id="Number对象"><a href="#Number对象" class="headerlink" title="Number对象"></a>Number对象</h2><h2 id="Number-对象"><a href="#Number-对象" class="headerlink" title="Number 对象"></a>Number 对象</h2><p>Number 对象是原始数值的包装对象。</p>
<p>Number 创建方式 new Number()。</p>
<h2 id="语法"><a href="#语法" class="headerlink" title="语法"></a>语法</h2><p>var num = new Number(value);</p>
<p><strong>注意：</strong> 如果一个参数值不能转换为一个数字将返回 NaN (非数字值)。</p>
<hr>
<h2 id="Number-对象属性"><a href="#Number-对象属性" class="headerlink" title="Number 对象属性"></a>Number 对象属性</h2><table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-constructor-number.html" target="_blank" rel="noopener">constructor</a></td>
<td align="left">返回对创建此对象的 Number 函数的引用。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-max-value.html" target="_blank" rel="noopener">MAX_VALUE</a></td>
<td align="left">可表示的最大的数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-min-value.html" target="_blank" rel="noopener">MIN_VALUE</a></td>
<td align="left">可表示的最小的数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-negative-infinity.html" target="_blank" rel="noopener">NEGATIVE_INFINITY</a></td>
<td align="left">负无穷大，溢出时返回该值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-number-nan.html" target="_blank" rel="noopener">NaN</a></td>
<td align="left">非数字值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-positive-infinity.html" target="_blank" rel="noopener">POSITIVE_INFINITY</a></td>
<td align="left">正无穷大，溢出时返回该值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-prototype-num.html" target="_blank" rel="noopener">prototype</a></td>
<td align="left">允许您可以向对象添加属性和方法。</td>
</tr>
</tbody></table>
<h2 id="Number-对象方法"><a href="#Number-对象方法" class="headerlink" title="Number 对象方法"></a>Number 对象方法</h2><table>
<thead>
<tr>
<th align="left">方法</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-isfinite-number.html" target="_blank" rel="noopener">isFinite</a></td>
<td align="left">检测指定参数是否为无穷大。</td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-toexponential.html" target="_blank" rel="noopener">toExponential(x)</a></td>
<td align="left">把对象的值转换为指数计数法。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tofixed.html" target="_blank" rel="noopener">toFixed(x)</a></td>
<td align="left">把数字转换为字符串，结果的小数点后有指定位数的数字。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-toprecision.html" target="_blank" rel="noopener">toPrecision(x)</a></td>
<td align="left">把数字格式化为指定的长度。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tostring-number.html" target="_blank" rel="noopener">toString()</a></td>
<td align="left">把数字转换为字符串，使用指定的基数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-valueof-number.html" target="_blank" rel="noopener">valueOf()</a></td>
<td align="left">返回一个 Number 对象的基本数字值。</td>
</tr>
</tbody></table>
<hr>
<h2 id="ES6-新增-Number-属性"><a href="#ES6-新增-Number-属性" class="headerlink" title="ES6 新增 Number 属性"></a>ES6 新增 Number 属性</h2><p>ES 6 增加了以下三个 Number 对象的属性：</p>
<ul>
<li>EPSILON: 表示 1 和比最接近 1 且大于 1 的最小 Number 之间的差别</li>
<li>MIN_SAFE_INTEGER: 表示在 JavaScript中最小的安全的 integer 型数字 (<code>-(253 - 1)</code>)。</li>
<li>MAX_SAFE_INTEGER: 表示在 JavaScript 中最大的安全整数（<code>253 - 1</code>）。</li>
</ul>
<h2 id="实例"><a href="#实例" class="headerlink" title="实例"></a>实例</h2><p>var x = Number.EPSILON;  var y = Number.MIN_SAFE_INTEGER;  var z = Number.MAX_SAFE_INTEGER;</p>
<p><a href="https://www.runoob.com/try/try.php?filename=tryjs_es6_epsilon" target="_blank" rel="noopener">尝试一下 »</a></p>
<hr>
<h2 id="ES6-新增-Number-方法"><a href="#ES6-新增-Number-方法" class="headerlink" title="ES6 新增 Number 方法"></a>ES6 新增 Number 方法</h2><p>ES 6 增加了以下两个 Number 对象的方法：</p>
<ul>
<li>Number.isInteger(): 用来判断给定的参数是否为整数。</li>
<li>Number.isSafeInteger(): 判断传入的参数值是否是一个”安全整数”。</li>
</ul>
<p>Number.isInteger() 在参数是整数时返回 true。</p>
<h2 id="实例-1"><a href="#实例-1" class="headerlink" title="实例"></a>实例</h2><p>Number.isInteger(10);        // 返回 true Number.isInteger(10.5);      // 返回 false</p>
<p><a href="https://www.runoob.com/try/try.php?filename=tryjs_es6_isinteger" target="_blank" rel="noopener">尝试一下 »</a></p>
<p>Number.isSafeInteger()判断传入的参数值是否是一个”安全整数”。</p>
<p>安全整数范围为 <code>-(253 - 1)到</code> <code>253 - 1</code>之间的整数，包含 <code>-(253 - 1)和</code> <code>253 - 1</code>。</p>
<h2 id="实例-2"><a href="#实例-2" class="headerlink" title="实例"></a>实例</h2><p>Number.isSafeInteger(10);    // 返回 true Number.isSafeInteger(12345678901234567890);  // 返回 false</p>
<h2 id="String对象"><a href="#String对象" class="headerlink" title="String对象"></a>String对象</h2><p>字符串属性</p>
<table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">constructor</td>
<td align="left">返回创建字符串属性的函数</td>
</tr>
<tr>
<td align="left">length</td>
<td align="left">返回字符串的长度</td>
</tr>
<tr>
<td align="left">prototype</td>
<td align="left">允许您向对象添加属性和方法</td>
</tr>
</tbody></table>
<p>字符串方法</p>
<table>
<thead>
<tr>
<th align="left">方法</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">charAt()</td>
<td align="left">返回指定索引位置的字符</td>
</tr>
<tr>
<td align="left">charCodeAt()</td>
<td align="left">返回指定索引位置字符的 Unicode 值</td>
</tr>
<tr>
<td align="left">concat()</td>
<td align="left">连接两个或多个字符串，返回连接后的字符串</td>
</tr>
<tr>
<td align="left">fromCharCode()</td>
<td align="left">将 Unicode 转换为字符串</td>
</tr>
<tr>
<td align="left">indexOf()</td>
<td align="left">返回字符串中检索指定字符第一次出现的位置</td>
</tr>
<tr>
<td align="left">lastIndexOf()</td>
<td align="left">返回字符串中检索指定字符最后一次出现的位置</td>
</tr>
<tr>
<td align="left">localeCompare()</td>
<td align="left">用本地特定的顺序来比较两个字符串</td>
</tr>
<tr>
<td align="left">match()</td>
<td align="left">找到一个或多个正则表达式的匹配</td>
</tr>
<tr>
<td align="left">replace()</td>
<td align="left">替换与正则表达式匹配的子串</td>
</tr>
<tr>
<td align="left">search()</td>
<td align="left">检索与正则表达式相匹配的值</td>
</tr>
<tr>
<td align="left">slice()</td>
<td align="left">提取字符串的片断，并在新的字符串中返回被提取的部分</td>
</tr>
<tr>
<td align="left">split()</td>
<td align="left">把字符串分割为子字符串数组</td>
</tr>
<tr>
<td align="left">substr()</td>
<td align="left">从起始索引号提取字符串中指定数目的字符</td>
</tr>
<tr>
<td align="left">substring()</td>
<td align="left">提取字符串中两个指定的索引号之间的字符</td>
</tr>
<tr>
<td align="left">toLocaleLowerCase()</td>
<td align="left">根据主机的语言环境把字符串转换为小写，只有几种语言（如土耳其语）具有地方特有的大小写映射</td>
</tr>
<tr>
<td align="left">toLocaleUpperCase()</td>
<td align="left">根据主机的语言环境把字符串转换为大写，只有几种语言（如土耳其语）具有地方特有的大小写映射</td>
</tr>
<tr>
<td align="left">toLowerCase()</td>
<td align="left">把字符串转换为小写</td>
</tr>
<tr>
<td align="left">toString()</td>
<td align="left">返回字符串对象值</td>
</tr>
<tr>
<td align="left">toUpperCase()</td>
<td align="left">把字符串转换为大写</td>
</tr>
<tr>
<td align="left">trim()</td>
<td align="left">移除字符串首尾空白</td>
</tr>
<tr>
<td align="left">valueOf()</td>
<td align="left">返回某个字符串对象的原始值</td>
</tr>
</tbody></table>
<h2 id="RegExp对象"><a href="#RegExp对象" class="headerlink" title="RegExp对象"></a>RegExp对象</h2><h2 id="全局属性-函数"><a href="#全局属性-函数" class="headerlink" title="全局属性/函数"></a>全局属性/函数</h2><p>JavaScript 全局属性和方法可用于创建Javascript对象。</p>
<h2 id="JavaScript-全局属性"><a href="#JavaScript-全局属性" class="headerlink" title="JavaScript 全局属性"></a>JavaScript 全局属性</h2><table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-infinity.html" target="_blank" rel="noopener">Infinity</a></td>
<td align="left">代表正的无穷大的数值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-nan.html" target="_blank" rel="noopener">NaN</a></td>
<td align="left">指示某个值是不是数字值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-undefined.html" target="_blank" rel="noopener">undefined</a></td>
<td align="left">指示未定义的值。</td>
</tr>
</tbody></table>
<h2 id="JavaScript-全局函数"><a href="#JavaScript-全局函数" class="headerlink" title="JavaScript 全局函数"></a>JavaScript 全局函数</h2><table>
<thead>
<tr>
<th align="left">函数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-decodeuri.html" target="_blank" rel="noopener">decodeURI()</a></td>
<td align="left">解码某个编码的 URI。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-decodeuricomponent.html" target="_blank" rel="noopener">decodeURIComponent()</a></td>
<td align="left">解码一个编码的 URI 组件。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-encodeuri.html" target="_blank" rel="noopener">encodeURI()</a></td>
<td align="left">把字符串编码为 URI。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-encodeuricomponent.html" target="_blank" rel="noopener">encodeURIComponent()</a></td>
<td align="left">把字符串编码为 URI 组件。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-escape.html" target="_blank" rel="noopener">escape()</a></td>
<td align="left">对字符串进行编码。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-eval.html" target="_blank" rel="noopener">eval()</a></td>
<td align="left">计算 JavaScript 字符串，并把它作为脚本代码来执行。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-isfinite.html" target="_blank" rel="noopener">isFinite()</a></td>
<td align="left">检查某个值是否为有穷大的数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-isnan.html" target="_blank" rel="noopener">isNaN()</a></td>
<td align="left">检查某个值是否是数字。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-number.html" target="_blank" rel="noopener">Number()</a></td>
<td align="left">把对象的值转换为数字。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-parsefloat.html" target="_blank" rel="noopener">parseFloat()</a></td>
<td align="left">解析一个字符串并返回一个浮点数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-parseint.html" target="_blank" rel="noopener">parseInt()</a></td>
<td align="left">解析一个字符串并返回一个整数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-string.html" target="_blank" rel="noopener">String()</a></td>
<td align="left">把对象的值转换为字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-unescape.html" target="_blank" rel="noopener">unescape()</a></td>
<td align="left">对由 escape() 编码的字符串进行解码。</td>
</tr>
</tbody></table>
<h2 id="运算符-算术、赋值、字符串、比较、条件、逻辑、位"><a href="#运算符-算术、赋值、字符串、比较、条件、逻辑、位" class="headerlink" title="运算符  算术、赋值、字符串、比较、条件、逻辑、位"></a>运算符  <code>算术、赋值、字符串、比较、条件、逻辑、位</code></h2><h3 id="算术运算符-（自增）-（自减）"><a href="#算术运算符-（自增）-（自减）" class="headerlink" title="算术运算符 + - * / % ++（自增）--（自减）"></a>算术运算符 <code>+ - * / % ++（自增）--（自减）</code></h3><h3 id="赋值运算符"><a href="#赋值运算符" class="headerlink" title="赋值运算符    = += -= *= /= %="></a>赋值运算符    <code>= += -= *= /= %=</code></h3><blockquote>
<p>x 符号= y  x = x 符号 y</p>
</blockquote>
<h3 id="字符串运算符-运算符，-运算符可用于连接字符串。"><a href="#字符串运算符-运算符，-运算符可用于连接字符串。" class="headerlink" title="字符串运算符 \+ 运算符， += 运算符可用于连接字符串。"></a>字符串运算符 <code>\+ 运算符， += 运算符可用于连接字符串。</code></h3><h3 id="比较运算符-等于-（恒等于）-（不等于）-（不恒等于）-gt-lt-gt-lt"><a href="#比较运算符-等于-（恒等于）-（不等于）-（不恒等于）-gt-lt-gt-lt" class="headerlink" title="比较运算符 ==(等于)  ===（恒等于） !=（不等于）  !==（不恒等于）  &gt;  &lt;  &gt;=  &lt;="></a>比较运算符 <code>==(等于)  ===（恒等于） !=（不等于）  !==（不恒等于）  &gt;  &lt;  &gt;=  &lt;=</code></h3><h3 id="条件运算符-变量-条件-值1-值2"><a href="#条件运算符-变量-条件-值1-值2" class="headerlink" title="条件运算符  变量 = (条件) ? 值1:值2"></a>条件运算符  <code>变量 = (条件) ? 值1:值2</code></h3><h3 id="逻辑运算符-amp-amp-（和）-（或）-非"><a href="#逻辑运算符-amp-amp-（和）-（或）-非" class="headerlink" title="逻辑运算符  &amp;&amp;（和） ||（或） !(非)"></a>逻辑运算符  <code>&amp;&amp;（和） ||（或） !(非)</code></h3><h3 id="位运算符-amp-and-和-OR-取反-（异或）-lt-lt-（左移）-gt-gt-右移"><a href="#位运算符-amp-and-和-OR-取反-（异或）-lt-lt-（左移）-gt-gt-右移" class="headerlink" title="位运算符    &amp;(and 和) | (OR) ~(取反) ^（异或）  &lt;&lt;（左移）  &gt;&gt;(右移)"></a>位运算符    <code>&amp;(and 和) | (OR) ~(取反) ^（异或）  &lt;&lt;（左移）  &gt;&gt;(右移)</code></h3><h2 id="Error"><a href="#Error" class="headerlink" title="Error"></a>Error</h2><p>Error对象</p>
<p>Error对象在错误发生时提供了错误的提示信息</p>
<h3 id="Error-对象属性"><a href="#Error-对象属性" class="headerlink" title="Error 对象属性"></a>Error 对象属性</h3><table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/prop-error-name.html" target="_blank" rel="noopener">name</a></td>
<td align="left">设置或返回一个错误名</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/prop-error-message.html" target="_blank" rel="noopener">message</a></td>
<td align="left">设置或返回一个错误信息(字符串)</td>
</tr>
</tbody></table>
<h2 id="进制"><a href="#进制" class="headerlink" title="进制"></a>进制</h2><p>二进制</p>
<p>进制</p>
<p>进制</p>
<h2 id="JavaScript内置对象-9种-Number-Array-String-prototype-Object-Date-Boolearn-Math"><a href="#JavaScript内置对象-9种-Number-Array-String-prototype-Object-Date-Boolearn-Math" class="headerlink" title="JavaScript内置对象  9种 Number Array String prototype Object Date Boolearn Math"></a>JavaScript内置对象  <code>9种 Number Array String prototype Object Date Boolearn Math</code></h2><p><a href="https://www.cnblogs.com/mafeng/p/5225391.html" target="_blank" rel="noopener">Javascript的io操作 - ma_fighting - 博客园</a></p>
<h3 id="Object"><a href="#Object" class="headerlink" title="Object"></a>Object</h3><h3 id="prototype"><a href="#prototype" class="headerlink" title="prototype"></a>prototype</h3><h3 id="Number-浮点型类型"><a href="#Number-浮点型类型" class="headerlink" title="Number 浮点型类型"></a>Number <code>浮点型类型</code></h3><h3 id="JavaScript-只有一种数字类型"><a href="#JavaScript-只有一种数字类型" class="headerlink" title="JavaScript 只有一种数字类型"></a>JavaScript 只有一种数字类型</h3><p>不使用小数点可以，使用小数点可以</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">const num &#x3D; 123</span><br><span class="line">const num &#x3D; 123.1223</span><br></pre></td></tr></table></figure>

<p>极大或极小数的数字可通过科学（指数）计数法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">const num &#x3D; 123e5; &#x2F;&#x2F;12300000</span><br><span class="line">const num &#x3D; 123e-5;0.00123</span><br></pre></td></tr></table></figure>

<h3 id="JavaScript数字为64位-在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由-浮点型类型。"><a href="#JavaScript数字为64位-在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由-浮点型类型。" class="headerlink" title="JavaScript数字为64位 在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由 浮点型类型。"></a>JavaScript数字为64位 <code>在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由 浮点型类型。</code></h3><p>JavaScript 不是类型语言。与许多其他编程语言不同，JavaScript 不定义不同类型的数字，比如整数、短、长、浮点等等。</p>
<p>在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由 浮点型类型。</p>
<h3 id="精度"><a href="#精度" class="headerlink" title="精度"></a>精度</h3><p>整数（不使用小数点或指数计数法）最多为 15 位。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">var x &#x3D; 999999999999999; &#x2F;&#x2F;15  &#x2F;&#x2F; x 为 999999999999999  15位</span><br><span class="line">var y &#x3D; 9999999999999999;&#x2F;&#x2F;16  &#x2F;&#x2F; y 为 10000000000000000  17位</span><br></pre></td></tr></table></figure>



<p>小数的最大位数是 17，但是浮点运算并不总是 100% 准确：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">var x &#x3D; 0.2+0.1; &#x2F;&#x2F; 输出结果为 0.30000000000000004</span><br></pre></td></tr></table></figure>



<h3 id="特殊值"><a href="#特殊值" class="headerlink" title="特殊值"></a>特殊值</h3><h4 id="无穷大（infinity）是一个数字-infinity-负无穷大"><a href="#无穷大（infinity）是一个数字-infinity-负无穷大" class="headerlink" title="无穷大（infinity）是一个数字  -infinity 负无穷大"></a>无穷大（infinity）<code>是一个数字  -infinity 负无穷大</code></h4><p>当数字运算结果超过了JavaScript所能表示的数字上限（溢出），结果为一个特殊的无穷大（infinity）值</p>
<p>当负数的值超过了JavaScript所能表示的负数范围，结果为负无穷大</p>
<h4 id="非数字值（NaN）true-gt-不是数字-false-gt-是数字"><a href="#非数字值（NaN）true-gt-不是数字-false-gt-是数字" class="headerlink" title="非数字值（NaN）true =&gt;不是数字 false =&gt;是数字"></a>非数字值（NaN）<code>true =&gt;不是数字 false =&gt;是数字</code></h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">isNaN（是不是数字） 全局函数判断一个值是否是NaN值（即使数字）是数字返回false 不是数字返回true</span><br><span class="line"> console.log(isNaN(999&#x2F;0)); &#x2F;&#x2F; 返回false 是一个数字 除以0是无穷大，无穷大是一个数字:</span><br><span class="line"> console.log(isNaN(-999&#x2F;0)); &#x2F;&#x2F; 返回false 是一个数字 除以0是无穷大，负无穷大是一个数字: -Infinity</span><br></pre></td></tr></table></figure>



<h3 id="进制-1"><a href="#进制-1" class="headerlink" title="进制"></a>进制</h3><p>二进制、八进制、十进制、十六进制</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">使用 toString() 方法 输出16进制、8进制、2进制 toString(要装换的进制数)</span><br><span class="line"> const num &#x3D; 12</span><br><span class="line"> console.log(num.toString(2))</span><br><span class="line"> console.log(num.toString(8))</span><br><span class="line"> console.log(num.toString(10))</span><br><span class="line"> console.log(num.toString(16))</span><br></pre></td></tr></table></figure>





<h3 id="属性"><a href="#属性" class="headerlink" title="属性"></a>属性</h3><table>
<thead>
<tr>
<th align="center">属性</th>
<th align="left"></th>
</tr>
</thead>
<tbody><tr>
<td align="center">MAX_VALUE</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">MIN_VALUE</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">NEGATIVE_INFINITY</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">POSITIVE_INFINITY</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">NaN</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">prototype</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">constructor</td>
<td align="left"></td>
</tr>
</tbody></table>
<h3 id="方法"><a href="#方法" class="headerlink" title="方法"></a>方法</h3><table>
<thead>
<tr>
<th align="center">方法</th>
<th align="left"></th>
</tr>
</thead>
<tbody><tr>
<td align="center">toExponential</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">toFixed()</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">toPrecision()</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">toString()</td>
<td align="left"></td>
</tr>
<tr>
<td align="center">valueOf()</td>
<td align="left"></td>
</tr>
</tbody></table>
<h3 id="String"><a href="#String" class="headerlink" title="String"></a>String</h3><p>属性:</p>
<table>
<thead>
<tr>
<th align="left"></th>
<th align="left"></th>
</tr>
</thead>
<tbody><tr>
<td align="left">length</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">prototype</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">constructor</td>
<td align="left"></td>
</tr>
</tbody></table>
<ul>
<li>length</li>
<li>prototype</li>
<li>constructor</li>
</ul>
<p>方法:</p>
<ul>
<li>charAt()</li>
<li>charCodeAt()</li>
<li>concat()</li>
<li>fromCharCode()</li>
<li>indexOf()</li>
<li>lastIndexOf()</li>
<li>match()</li>
<li>replace()</li>
<li>search()</li>
<li>slice()</li>
<li>split()</li>
<li>substr()</li>
<li>substring()</li>
<li>toLowerCase()</li>
<li>toUpperCase()</li>
<li>valueOf()</li>
</ul>
<h3 id="Date"><a href="#Date" class="headerlink" title="Date"></a>Date</h3><h3 id="Array"><a href="#Array" class="headerlink" title="Array"></a>Array</h3><p>数组对象的作用是：使用单独的变量名来存储一系列的值</p>
<h3 id="创建-var-arr-quot-Hello-quot-quot-World-quot-quot-JavaScript-quot"><a href="#创建-var-arr-quot-Hello-quot-quot-World-quot-quot-JavaScript-quot" class="headerlink" title="创建 var arr = [&quot;Hello&quot;,&quot;World&quot;,&quot;JavaScript&quot;]"></a>创建 <code>var arr = [&quot;Hello&quot;,&quot;World&quot;,&quot;JavaScript&quot;]</code></h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">1.常规方法</span><br><span class="line">var arr &#x3D; new Array();</span><br><span class="line">arr[0] &#x3D; &quot;Hello&quot;</span><br><span class="line">arr[1] &#x3D; &quot;World&quot;</span><br><span class="line">arr[2] &#x3D; &quot;JavaScript&quot;</span><br><span class="line">2.简洁方法</span><br><span class="line">var arr &#x3D; new Array(&quot;Hello&quot;,&quot;World&quot;,&quot;JavaScript&quot;)</span><br><span class="line"></span><br><span class="line">3.字面</span><br><span class="line">var arr &#x3D; [&quot;Hello&quot;,&quot;World&quot;,&quot;JavaScript&quot;]</span><br></pre></td></tr></table></figure>



<h3 id="访问"><a href="#访问" class="headerlink" title="访问"></a>访问</h3><p>数组下标从0<strong>开始访问</strong></p>
<h2 id="数组属性"><a href="#数组属性" class="headerlink" title="数组属性"></a>数组属性</h2><table>
<thead>
<tr>
<th align="left">属性</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-constructor-array.html" target="_blank" rel="noopener">constructor</a></td>
<td align="left">返回创建数组对象的原型函数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-length-array.html" target="_blank" rel="noopener">length</a></td>
<td align="left">设置或返回数组元素的个数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-prototype-array.html" target="_blank" rel="noopener">prototype</a></td>
<td align="left">允许你向数组对象添加属性或方法。</td>
</tr>
</tbody></table>
<h3 id="数组方法"><a href="#数组方法" class="headerlink" title="数组方法"></a>数组方法</h3><h2 id="Array-对象方法-30个方法"><a href="#Array-对象方法-30个方法" class="headerlink" title="Array 对象方法 30个方法"></a>Array 对象方法 <code>30个方法</code></h2><table>
<thead>
<tr>
<th align="left">方法</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-concat-array.html" target="_blank" rel="noopener">concat()</a></td>
<td align="left">连接两个或更多的数组，并返回结果。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-copywithin.html" target="_blank" rel="noopener">copyWithin()</a></td>
<td align="left">从数组的指定位置拷贝元素到数组的另一个指定位置中。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-entries.html" target="_blank" rel="noopener">entries()</a></td>
<td align="left">返回数组的可迭代对象。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-every.html" target="_blank" rel="noopener">every()</a></td>
<td align="left">检测数值元素的每个元素是否都符合条件。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-fill.html" target="_blank" rel="noopener">fill()</a></td>
<td align="left">使用一个固定值来填充数组。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-filter.html" target="_blank" rel="noopener">filter()</a></td>
<td align="left">检测数值元素，并返回符合条件所有元素的数组。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-find.html" target="_blank" rel="noopener">find()</a></td>
<td align="left">返回符合传入测试（函数）条件的数组元素。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-findindex.html" target="_blank" rel="noopener">findIndex()</a></td>
<td align="left">返回符合传入测试（函数）条件的数组元素索引。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-foreach.html" target="_blank" rel="noopener">forEach()</a></td>
<td align="left">数组每个元素都执行一次回调函数。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-from.html" target="_blank" rel="noopener">from()</a></td>
<td align="left">通过给定的对象中创建一个数组。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-includes.html" target="_blank" rel="noopener">includes()</a></td>
<td align="left">判断一个数组是否包含一个指定的值。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-indexof-array.html" target="_blank" rel="noopener">indexOf()</a></td>
<td align="left">搜索数组中的元素，并返回它所在的位置。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-isarray.html" target="_blank" rel="noopener">isArray()</a></td>
<td align="left">判断对象是否为数组。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-join.html" target="_blank" rel="noopener">join()</a></td>
<td align="left">把数组的所有元素放入一个字符串。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-keys.html" target="_blank" rel="noopener">keys()</a></td>
<td align="left">返回数组的可迭代对象，包含原始数组的键(key)。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-lastindexof-array.html" target="_blank" rel="noopener">lastIndexOf()</a></td>
<td align="left">搜索数组中的元素，并返回它最后出现的位置。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-map.html" target="_blank" rel="noopener">map()</a></td>
<td align="left">通过指定函数处理数组的每个元素，并返回处理后的数组。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-pop.html" target="_blank" rel="noopener">pop()</a></td>
<td align="left">删除数组的最后一个元素并返回删除的元素。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-push.html" target="_blank" rel="noopener">push()</a></td>
<td align="left">向数组的末尾添加一个或更多元素，并返回新的长度。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-reduce.html" target="_blank" rel="noopener">reduce()</a></td>
<td align="left">将数组元素计算为一个值（从左到右）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-reduceright.html" target="_blank" rel="noopener">reduceRight()</a></td>
<td align="left">将数组元素计算为一个值（从右到左）。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-reverse.html" target="_blank" rel="noopener">reverse()</a></td>
<td align="left">反转数组的元素顺序。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-shift.html" target="_blank" rel="noopener">shift()</a></td>
<td align="left">删除并返回数组的第一个元素。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-slice-array.html" target="_blank" rel="noopener">slice()</a></td>
<td align="left">选取数组的的一部分，并返回一个新数组。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-some.html" target="_blank" rel="noopener">some()</a></td>
<td align="left">检测数组元素中是否有元素符合指定条件。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-sort.html" target="_blank" rel="noopener">sort()</a></td>
<td align="left">对数组的元素进行排序。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-splice.html" target="_blank" rel="noopener">splice()</a></td>
<td align="left">从数组中添加或删除元素。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-tostring-array.html" target="_blank" rel="noopener">toString()</a></td>
<td align="left">把数组转换为字符串，并返回结果。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-unshift.html" target="_blank" rel="noopener">unshift()</a></td>
<td align="left">向数组的开头添加一个或更多元素，并返回新的长度。</td>
</tr>
<tr>
<td align="left"><a href="https://www.runoob.com/jsref/jsref-valueof-array.html" target="_blank" rel="noopener">valueOf()</a></td>
<td align="left">返回数组对象的原始值。</td>
</tr>
</tbody></table>
<p>创建自定义的数组方法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">Array.prototype.myUcase &#x3D; function()&#123;</span><br><span class="line">    for(i &#x3D; 0;i &lt; this.length;i++)&#123;</span><br><span class="line">        this[i] &#x3D; this[i].toUpperCase();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">格式</span><br><span class="line">Array.prototype.方法名 &#x3D; function()&#123;</span><br><span class="line">    函数体;</span><br><span class="line">&#125;</span><br><span class="line">使用方法</span><br><span class="line">数组.方法名()</span><br></pre></td></tr></table></figure>









<h3 id="Boolean"><a href="#Boolean" class="headerlink" title="Boolean"></a>Boolean</h3><h3 id="Math"><a href="#Math" class="headerlink" title="Math"></a>Math</h3><p>Math(算数) 对象的作用</p>
<table>
<thead>
<tr>
<th align="left"></th>
<th align="left"></th>
</tr>
</thead>
<tbody><tr>
<td align="left">round()</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">random()</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">max()</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">min()</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr>
<td align="left"></td>
<td align="left"></td>
</tr>
</tbody></table>
<h3 id="RegExp"><a href="#RegExp" class="headerlink" title="RegExp"></a>RegExp</h3>
    </div>

    
    
    
        <div class="reward-container">
  <div></div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wechatpay.jpg" alt="heweiliang 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/alipay.jpg" alt="heweiliang 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E5%89%8D%E7%AB%AF/" rel="tag"># 前端</a>
              <a href="/tags/JavaScript/" rel="tag"># JavaScript</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/04/13/%E9%9D%99%E6%80%81blog/Markdown/%E5%AF%8C%E6%96%87%E6%9C%AC%E7%BC%96%E8%BE%91%E5%99%A8/" rel="prev" title="静态blog/Markdown/富文本编辑器">
      <i class="fa fa-chevron-left"></i> 静态blog/Markdown/富文本编辑器
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/04/13/%E5%89%8D%E7%AB%AF/%E5%AE%9E%E4%BE%8B/" rel="next" title="前端/实例">
      前端/实例 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    
  <div class="comments">
    <div id="lv-container" data-id="city" data-uid="MTAyMC81MDY1MC8yNzEzMw=="></div>
  </div>
  

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#JavaScript对象"><span class="nav-number">1.</span> <span class="nav-text">JavaScript对象</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Array对象"><span class="nav-number">1.1.</span> <span class="nav-text">Array对象</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#concat-方法-数组连接"><span class="nav-number">1.1.1.</span> <span class="nav-text">concat()方法    数组连接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#copyWithin-方法-同一数组元素的位置调换"><span class="nav-number">1.1.2.</span> <span class="nav-text">copyWithin()方法 同一数组元素的位置调换</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#entries-ES6"><span class="nav-number">1.1.3.</span> <span class="nav-text">entries(ES6)</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Boolean对象-constructor-prototype-toString-valueOf"><span class="nav-number">1.2.</span> <span class="nav-text">Boolean对象 constructor prototype toString() valueOf()</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#新建一个Boolean对象"><span class="nav-number">1.2.1.</span> <span class="nav-text">新建一个Boolean对象</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#对象属性"><span class="nav-number">1.2.2.</span> <span class="nav-text">对象属性</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#constru-ctor-返回对创建此对象的-Boolean-函数的引用"><span class="nav-number">1.2.2.1.</span> <span class="nav-text">constru ctor 返回对创建此对象的 Boolean 函数的引用</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#prototype-使您有能力向对象添加属性和方法。"><span class="nav-number">1.2.2.2.</span> <span class="nav-text">prototype 使您有能力向对象添加属性和方法。</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#对象方法toSting-转为字符串-valueOf-返回原始值"><span class="nav-number">1.2.3.</span> <span class="nav-text">对象方法toSting() 转为字符串 valueOf() 返回原始值</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#toString-布尔值转为字符串，并返回结果"><span class="nav-number">1.2.3.1.</span> <span class="nav-text">toString() 布尔值转为字符串，并返回结果</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#valueOf-返回-Boolean-对象的原始值"><span class="nav-number">1.2.3.2.</span> <span class="nav-text">valueOf() 返回 Boolean 对象的原始值</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Dat对象"><span class="nav-number">1.3.</span> <span class="nav-text">Dat对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Date-对象"><span class="nav-number">1.4.</span> <span class="nav-text">Date 对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Date-对象属性"><span class="nav-number">1.5.</span> <span class="nav-text">Date 对象属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Date-对象方法"><span class="nav-number">1.6.</span> <span class="nav-text">Date 对象方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Math对象"><span class="nav-number">1.7.</span> <span class="nav-text">Math对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Math-对象属性"><span class="nav-number">1.8.</span> <span class="nav-text">Math 对象属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Math-对象方法"><span class="nav-number">1.9.</span> <span class="nav-text">Math 对象方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Number对象"><span class="nav-number">1.10.</span> <span class="nav-text">Number对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Number-对象"><span class="nav-number">1.11.</span> <span class="nav-text">Number 对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#语法"><span class="nav-number">1.12.</span> <span class="nav-text">语法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Number-对象属性"><span class="nav-number">1.13.</span> <span class="nav-text">Number 对象属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Number-对象方法"><span class="nav-number">1.14.</span> <span class="nav-text">Number 对象方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ES6-新增-Number-属性"><span class="nav-number">1.15.</span> <span class="nav-text">ES6 新增 Number 属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实例"><span class="nav-number">1.16.</span> <span class="nav-text">实例</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ES6-新增-Number-方法"><span class="nav-number">1.17.</span> <span class="nav-text">ES6 新增 Number 方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实例-1"><span class="nav-number">1.18.</span> <span class="nav-text">实例</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实例-2"><span class="nav-number">1.19.</span> <span class="nav-text">实例</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#String对象"><span class="nav-number">1.20.</span> <span class="nav-text">String对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#RegExp对象"><span class="nav-number">1.21.</span> <span class="nav-text">RegExp对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#全局属性-函数"><span class="nav-number">1.22.</span> <span class="nav-text">全局属性&#x2F;函数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#JavaScript-全局属性"><span class="nav-number">1.23.</span> <span class="nav-text">JavaScript 全局属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#JavaScript-全局函数"><span class="nav-number">1.24.</span> <span class="nav-text">JavaScript 全局函数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#运算符-算术、赋值、字符串、比较、条件、逻辑、位"><span class="nav-number">1.25.</span> <span class="nav-text">运算符  算术、赋值、字符串、比较、条件、逻辑、位</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#算术运算符-（自增）-（自减）"><span class="nav-number">1.25.1.</span> <span class="nav-text">算术运算符 + - * &#x2F; % ++（自增）--（自减）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#赋值运算符"><span class="nav-number">1.25.2.</span> <span class="nav-text">赋值运算符    &#x3D; +&#x3D; -&#x3D; *&#x3D; &#x2F;&#x3D; %&#x3D;</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#字符串运算符-运算符，-运算符可用于连接字符串。"><span class="nav-number">1.25.3.</span> <span class="nav-text">字符串运算符 \+ 运算符， +&#x3D; 运算符可用于连接字符串。</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#比较运算符-等于-（恒等于）-（不等于）-（不恒等于）-gt-lt-gt-lt"><span class="nav-number">1.25.4.</span> <span class="nav-text">比较运算符 &#x3D;&#x3D;(等于)  &#x3D;&#x3D;&#x3D;（恒等于） !&#x3D;（不等于）  !&#x3D;&#x3D;（不恒等于）  &gt;  &lt;  &gt;&#x3D;  &lt;&#x3D;</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#条件运算符-变量-条件-值1-值2"><span class="nav-number">1.25.5.</span> <span class="nav-text">条件运算符  变量 &#x3D; (条件) ? 值1:值2</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#逻辑运算符-amp-amp-（和）-（或）-非"><span class="nav-number">1.25.6.</span> <span class="nav-text">逻辑运算符  &amp;&amp;（和） ||（或） !(非)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#位运算符-amp-and-和-OR-取反-（异或）-lt-lt-（左移）-gt-gt-右移"><span class="nav-number">1.25.7.</span> <span class="nav-text">位运算符    &amp;(and 和) | (OR) ~(取反) ^（异或）  &lt;&lt;（左移）  &gt;&gt;(右移)</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Error"><span class="nav-number">1.26.</span> <span class="nav-text">Error</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Error-对象属性"><span class="nav-number">1.26.1.</span> <span class="nav-text">Error 对象属性</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#进制"><span class="nav-number">1.27.</span> <span class="nav-text">进制</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#JavaScript内置对象-9种-Number-Array-String-prototype-Object-Date-Boolearn-Math"><span class="nav-number">1.28.</span> <span class="nav-text">JavaScript内置对象  9种 Number Array String prototype Object Date Boolearn Math</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Object"><span class="nav-number">1.28.1.</span> <span class="nav-text">Object</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#prototype"><span class="nav-number">1.28.2.</span> <span class="nav-text">prototype</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Number-浮点型类型"><span class="nav-number">1.28.3.</span> <span class="nav-text">Number 浮点型类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#JavaScript-只有一种数字类型"><span class="nav-number">1.28.4.</span> <span class="nav-text">JavaScript 只有一种数字类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#JavaScript数字为64位-在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由-浮点型类型。"><span class="nav-number">1.28.5.</span> <span class="nav-text">JavaScript数字为64位 在JavaScript中，数字不分为整数类型和浮点型类型，所有的数字都是由 浮点型类型。</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#精度"><span class="nav-number">1.28.6.</span> <span class="nav-text">精度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#特殊值"><span class="nav-number">1.28.7.</span> <span class="nav-text">特殊值</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#无穷大（infinity）是一个数字-infinity-负无穷大"><span class="nav-number">1.28.7.1.</span> <span class="nav-text">无穷大（infinity）是一个数字  -infinity 负无穷大</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#非数字值（NaN）true-gt-不是数字-false-gt-是数字"><span class="nav-number">1.28.7.2.</span> <span class="nav-text">非数字值（NaN）true &#x3D;&gt;不是数字 false &#x3D;&gt;是数字</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#进制-1"><span class="nav-number">1.28.8.</span> <span class="nav-text">进制</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#属性"><span class="nav-number">1.28.9.</span> <span class="nav-text">属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#方法"><span class="nav-number">1.28.10.</span> <span class="nav-text">方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#String"><span class="nav-number">1.28.11.</span> <span class="nav-text">String</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Date"><span class="nav-number">1.28.12.</span> <span class="nav-text">Date</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Array"><span class="nav-number">1.28.13.</span> <span class="nav-text">Array</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#创建-var-arr-quot-Hello-quot-quot-World-quot-quot-JavaScript-quot"><span class="nav-number">1.28.14.</span> <span class="nav-text">创建 var arr &#x3D; [&quot;Hello&quot;,&quot;World&quot;,&quot;JavaScript&quot;]</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#访问"><span class="nav-number">1.28.15.</span> <span class="nav-text">访问</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#数组属性"><span class="nav-number">1.29.</span> <span class="nav-text">数组属性</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#数组方法"><span class="nav-number">1.29.1.</span> <span class="nav-text">数组方法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Array-对象方法-30个方法"><span class="nav-number">1.30.</span> <span class="nav-text">Array 对象方法 30个方法</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Boolean"><span class="nav-number">1.30.1.</span> <span class="nav-text">Boolean</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Math"><span class="nav-number">1.30.2.</span> <span class="nav-text">Math</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#RegExp"><span class="nav-number">1.30.3.</span> <span class="nav-text">RegExp</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="heweiliang"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">heweiliang</p>
  <div class="site-description" itemprop="description">heweiliang blog</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">96</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">18</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">24</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/yourname" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i></a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:yourname@gmail.com" title="E-Mail → mailto:yourname@gmail.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i></a>
      </span>
      <span class="links-of-author-item">
        <a href="https://plus.google.com/yourname" title="Google → https:&#x2F;&#x2F;plus.google.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fa fa-fw fa-google"></i></a>
      </span>
      <span class="links-of-author-item">
        <a href="https://stackoverflow.com/yourname" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fa fa-fw fa-stack-overflow"></i></a>
      </span>
  </div>
  <div class="cc-license motion-element" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com">Title</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com">Title2</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com">Title3</a>
        </li>
    </ul>
  </div>

      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">heweiliang</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    <span title="站点总字数">376k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">5:42</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>


  <script defer src="/lib/three/three.min.js"></script>
    <script defer src="/lib/three/three-waves.min.js"></script>
    <script defer src="/lib/three/canvas_lines.min.js"></script>


  




  
<script src="/js/local-search.js"></script>













  

  

<script>
NexT.utils.loadComments(document.querySelector('#lv-container'), () => {
  window.livereOptions = {
    refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '')
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
});
</script>

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginModelPath":"assets/","model":{"jsonPath":"/live2dw/assets/Epsilon2.1.model.json"},"display":{"position":"left","width":300,"height":600},"mobile":{"show":false},"log":false,"pluginJsPath":"lib/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
